package com.example.demomk;

import static kotlinx.coroutines.internal.LocalAtomics_commonKt.getValue;

import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;

import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;
import androidx.lifecycle.ViewModelProvider;
import androidx.recyclerview.widget.DefaultItemAnimator;
import androidx.recyclerview.widget.DividerItemDecoration;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.example.demomk.Adapter.RuleAdapter;
import com.example.demomk.Utils.CustomNavBar;
import com.example.demomk.Utils.StatRow;
import com.example.demomk.Utils.baseActivity;
import com.example.demomk.ViewModel.MeasurementViewModel;
import com.example.demomk.databinding.ActivityRuleBinding;
import com.example.demomk.entity.AvgMeasurement;
import com.example.demomk.entity.AvgMeasurementWithMeasurements;
import com.example.demomk.entity.Measurement;
import com.example.demomk.entity.SizeStats;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;

public class RuleActivity extends baseActivity {
    private ActivityRuleBinding binding;
    private MeasurementViewModel viewmodel;
    private RuleAdapter adapter;
    private RecyclerView recyclerView;
    private CustomNavBar navBar;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        EdgeToEdge.enable(this);
        binding = ActivityRuleBinding.inflate(getLayoutInflater());
        setContentView(binding.getRoot());
        ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
            Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
            v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
            return insets;
        });

        TextView dataText = binding.dataText;
        dataText.setSelected(true);

        navBar = new CustomNavBar(this);


        viewmodel = new ViewModelProvider(this).get(MeasurementViewModel.class);
        recyclerView = binding.ruleRecycler;
    }


}